﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UFrame.EventDispatch;
using System;

/// <summary>
/// 游戏事件代理
/// </summary>
public class EventAgent : AgentContext<EventAgent, EventDispatcher<int>>
{
    public static void RegistEvent(int key, Action action)
    {
        Instance.RegistEvent(key, action);
    }
    public static void RegistEvent<T>(int key, Action<T> action)
    {
        Instance.RegistEvent(key, action);
    }
    public static void RegistEvent<T1, T2>(int key, Action<T1, T2> action)
    {
        Instance.RegistEvent(key, action);
    }
    public static void RegistEvent<T1, T2, T3>(int key, Action<T1, T2, T3> action)
    {
        Instance.RegistEvent(key, action);
    }
    public static bool RemoveEvents(int key)
    {
        return Instance.RemoveEvents(key);
    }
    public static bool RemoveEvent(int key, Action action)
    {
        return Instance.RemoveEvent(key, action);
    }
    public static bool RemoveEvent<T>(int key, Action<T> action)
    {
        return Instance.RemoveEvent(key, action);
    }
    public static bool RemoveEvent<T1, T2>(int key, Action<T1, T2> action)
    {
        return Instance.RemoveEvent(key, action);
    }
    public static void ExecuteEvents(int key, params object[] arguments)
    {
        Instance.ExecuteEvents(key, arguments);
    }
}
